package com.bb.flow.api.entries;

import com.bb.flow.api.type.FlowEndType;

/**
 * @author bigbeard
 * 流程结束
 */
public class NotifyFlowEndInfo extends BaseFlowNotify {


    private final FlowEndType flowEndType;
    private final Object flowContext;

    private final NotifyParentFlowInfo parentFlowInfo;


    /**
     * @param flowTemplateName 流程模版名称
     * @param flowInstanceName 流程实例名称
     * @param flowEndType      结束类型
     * @param flowContext      流程上下文
     * @param parentFlowInfo   父流程信息
     */
    public NotifyFlowEndInfo(
            String flowTemplateName, String flowInstanceName, FlowEndType flowEndType,
            NotifyParentFlowInfo parentFlowInfo, Object flowContext) {
        this.setFlowInstanceName(flowInstanceName);
        this.setFlowTemplateName(flowTemplateName);
        this.flowEndType = flowEndType;
        this.flowContext = flowContext;
        this.parentFlowInfo = parentFlowInfo;
    }

    /**
     * 获取流程上下文信息
     *
     * @return 流程上下文
     */
    public Object getFlowContext() {
        return flowContext;
    }

    /**
     * 获取流程结束方式,正常和异常
     *
     * @return 结束方式
     */
    public FlowEndType getFlowEndType() {
        return flowEndType;
    }

    /**
     * 父流程信息
     *
     * @return
     */
    public NotifyParentFlowInfo getParentFlowInfo() {
        return parentFlowInfo;
    }
}
